package com.squirrel.michale;

import java.util.Arrays;

/**
 * TODO function description
 *
 * @author m30026548
 * @since 2025-04-11
 */
public class Day20250409_LeetCode003375 {

    public int minOperations(int[] nums, int k) {
        int min = Arrays.stream(nums).min().getAsInt();
        if (k > min) {
            return -1;
        }
        int operations = (int) Arrays.stream(nums).distinct().count();
        return operations - (k == min ? 1 : 0);
    }


}
